package com.crm.mapper;

import com.crm.dto.BusinessDTO;
import com.crm.pojo.Business;
import com.crm.pojo.BusinessRecord;
import com.crm.pojo.Referredsubject;
import com.crm.vo.BusinessChangeVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.time.LocalDateTime;
import java.util.List;
import java.util.ListResourceBundle;

@Mapper
public interface BusinessMapper {
    /**
     * 查询商机表
     * @param dto
     * @return
     */

    List<Business> query(BusinessDTO dto);

    /**
     * 新增商机
     * @param business
     */
    void addBusiness(Business business);


    @Select("select * from tb_business where  id = #{id}")
    Business getBusnissById(Long id);


    @Select("select * from communication_records where business_id = #{id} ")
    List<BusinessRecord> getHistoryById(Long id);


    int getAll(String beginCreateTime, String endCreateTime);

    List<BusinessChangeVO> getVOlist(String beginCreateTime, String endCreateTime);

    int getCluesNums(String beginCreateTime, String endCreateTime);

    List<BusinessChangeVO> getCluelist(String beginCreateTime, String endCreateTime);

    List<Business> querypool(BusinessDTO dto);
/*
@Select("select  * from tb_business where id in #{ids}")
    List<Business> queryBusinessById(List ids);
@Select("select user_name from tb_emp where id = #{currenrId}")
    String selectUserByid(Long currentId);
*/

    void gain(List ids);
}
